home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
prog
/
graphics
/
zoom.c
< prev
Wrap
C/C++ Source or Header
|
1994-08-05
|
625b
|
42 lines
#include <LEDA/plane.h>
#include <LEDA/window.h>
main()
{
window W;
W.init(-100000000, 100000000, -100000000);
int n = W.read_int("n = ");
list<segment> L;
point c(0,0);
segment s;
double r = 1000000000;
double alpha = 0;
double d = 2*M_PI/n;
for(int i = 0; i<n; i++)
{ point p(random(-10,+10),random(-10,+10));
s = segment(p,c.translate(alpha,r));
L.append(s);
alpha += d;
}
forall(s,L) W << s;
point p,q;
for(;;)
{ if (W.read_mouse(p)==3) break;
W.read_mouse_rect(p,q);
W.init(p.xcoord(),q.xcoord(),p.ycoord());
forall(s,L) W << s;
}
return 0;
}